#ifndef _FCTH_H_
#define _FCTH_H_

#pragma once

#include <vector>
#include <math.h>
#include "opencv2/imgproc/imgproc.hpp"

#include "Fuzzy10Bin.h"
#include "Fuzzy24Bin.h"
#include "FCTHQuant.h"
#include "FuzzyFCTHpart.h"
#include "RGB2HSV.h"

#ifndef MIN
#define MIN(a,b)  ((a) > (b) ? (b) : (a))
#endif

#ifndef MAX
#define MAX(a,b)  ((a) < (b) ? (b) : (a))
#endif

using namespace std;


class FCTH
{
public:
	FCTH(void);
	~FCTH(void);

	vector<double> Apply(cv::Mat& srcImg, int Method);

private:

	int		_Method;
	bool	_Compact;

	struct WaveletMatrix
	{
		double F1;
		double F2;
		double F3;
	};

	struct WaveletMatrixPlus
	{
		double F1;
		double F2;
		double F3;
		double Entropy;
	};

	struct SpatiaWaveletMatrix
	{
		double X;
		double Y;
		double Z0;
		double Z1;
		double Z2;
	};

private:

	WaveletMatrixPlus SinglePassThreshold(cv::Mat& inputMatrix, int level);
};

#endif